package com.atguigu.upp.mapper;

import com.atguigu.upp.bean.TagInfo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by Smexy on 2022/11/11
 */
public interface TagInfoMapper
{
    //需要知道某个计算task对应的tag信息
    @Select(" SELECT * FROM `tag_info` WHERE `tag_task_id` = #{taskId} ")
    TagInfo getTagInfoByTaskId(String taskId);

    //查询今天要计算的标签有哪些
    @Select("SELECT " +
            "  t2.* " +
            "FROM" +
            "(SELECT id taskId FROM `task_info` WHERE task_status = 1 ) t1" +
            " JOIN" +
            "( SELECT * FROM tag_info ) t2 " +
            "ON t1.taskId = t2.`tag_task_id` ")
    List<TagInfo> getTagInfoTodayExecute();
}
